/**
 * 
 */
package hb.software.service.message.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @author Mie
 * 消息实体，定义消息的三大属性：消息头(必须)、消息体(必须)、消息属性(可选)
 */
public class Message {
	//消息头：包含用于识别和为消息寻找路由的操作设置
	String messageHeader;
	//消息的内容
	String messageBody;
	//消息的属性
	String messageProperites;
	public String getMessageHeader() {
		return messageHeader;
	}
	public void setMessageHeader(String messageHeader) {
		this.messageHeader = messageHeader;
	}
	public String getMessageBody() {
		return messageBody;
	}
	public void setMessageBody(String messageBody) {
		this.messageBody = messageBody;
	}
	public String getMessageProperites() {
		return messageProperites;
	}
	public void setMessageProperites(String messageProperites) {
		this.messageProperites = messageProperites;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((messageBody == null) ? 0 : messageBody.hashCode());
		result = prime * result + ((messageHeader == null) ? 0 : messageHeader.hashCode());
		result = prime * result + ((messageProperites == null) ? 0 : messageProperites.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Message other = (Message) obj;
		if (messageBody == null) {
			if (other.messageBody != null)
				return false;
		} else if (!messageBody.equals(other.messageBody))
			return false;
		if (messageHeader == null) {
			if (other.messageHeader != null)
				return false;
		} else if (!messageHeader.equals(other.messageHeader))
			return false;
		if (messageProperites == null) {
			if (other.messageProperites != null)
				return false;
		} else if (!messageProperites.equals(other.messageProperites))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

}
